﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaseData;
using BaseData.UI;
using TaxBiz.House;
using TaxBiz.SysConfig;


namespace Admin.Zonghe
{
    public partial class QueryCondition : BaseCommon.BasePage
    {
        protected DataTable dtDepartmet = null;
        protected DataTable dtDiduan = null;
        protected DataTable dtXiangzhen = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!HasPower())
            {
                Jscript.AlertAndGoBack("您权限不足，不能操作");
                return;
            }
            //初始化绑定
            dtDepartmet = new DepartmentBiz().GetList();
            dtXiangzhen = new XiangzhenBiz().GetList();
            dtDiduan = new DiDuanBiz().GetList();
        }

        protected string OutputQueryFields()
        {
            TaxEntity.Tax.ZongheQueryEntity tqe = new TaxEntity.Tax.ZongheQueryEntity();
            Dictionary<string, string> dic = tqe.QueryDic;
            StringBuilder sb = new StringBuilder();
            int i = 0;
            foreach (KeyValuePair<string, string> pair in dic)
            {
                if (i % 4 == 0)
                {
                    sb.Append("<tr style='padding: 2px 0 2px 10px; height: 34px;'>");
                }
                sb.Append("<td style='width: 25%; padding-left: 10px;'>");
                sb.AppendFormat("<input type='checkbox' name='ckOutputFields' id='ckOutputFields{0}' value='{1}'><label for='ckOutputFields{0}'>{2}</label>", i, pair.Key, pair.Value);
                sb.Append("</td>");
                if ((i+1) % 4 == 0 || i == dic.Count-1)
                {
                    sb.Append("</tr>");
                }
                i++;
            }
            return sb.ToString();
        }
    }
}